#ifndef _IMYSQL_FRONT_H_
#define _IMYSQL_FRONT_H_


#include "wx/frame.h"
#include "conndlg.h"
#include "BLL/bll.h"

#define ID_MainFrame 10000
#define SYMBOL_IMYSQL_FRONT_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxMAXIMIZE
#define SYMBOL_IMYSQL_FRONT_TITLE _("iMySQL-Front")
#define SYMBOL_IMYSQL_FRONT_IDNAME ID_MainFrame
#define SYMBOL_IMYSQL_FRONT_SIZE wxSize(900, 600)
#define SYMBOL_IMYSQL_FRONT_POSITION wxDefaultPosition

class iMySQL_Front: public wxFrame
{    
    DECLARE_CLASS( iMySQL_Front )
    DECLARE_EVENT_TABLE()
	friend class Edit;
public:
	void OnMouseRightClickTreeCtrl(wxTreeEvent& event);
    iMySQL_Front();
    iMySQL_Front( wxWindow* parent, wxWindowID id = SYMBOL_IMYSQL_FRONT_IDNAME, const wxString& caption = VERSION, const wxPoint& pos = SYMBOL_IMYSQL_FRONT_POSITION, const wxSize& size = SYMBOL_IMYSQL_FRONT_SIZE, long style = SYMBOL_IMYSQL_FRONT_STYLE );
    iMySQL_Front( wxWindow* parent, ServerInfo* serverInfo,wxWindowID id = SYMBOL_IMYSQL_FRONT_IDNAME, const wxString& caption = VERSION, const wxPoint& pos = SYMBOL_IMYSQL_FRONT_POSITION, const wxSize& size = SYMBOL_IMYSQL_FRONT_SIZE, long style = SYMBOL_IMYSQL_FRONT_STYLE );
	//iMySQL_Front(/*wxMutex* mutex,*/wxWindow* parent, ServerInfo* serverInfo,wxWindowID id = SYMBOL_IMYSQL_FRONT_IDNAME, const wxString& caption = VERSION, const wxPoint& pos = SYMBOL_IMYSQL_FRONT_POSITION, const wxSize& size = SYMBOL_IMYSQL_FRONT_SIZE, long style = SYMBOL_IMYSQL_FRONT_STYLE );
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_IMYSQL_FRONT_IDNAME, const wxString& caption = VERSION, const wxPoint& pos = SYMBOL_IMYSQL_FRONT_POSITION, const wxSize& size = SYMBOL_IMYSQL_FRONT_SIZE, long style = SYMBOL_IMYSQL_FRONT_STYLE );
    ~iMySQL_Front();
    void CreateControls(ServerInfo* serverInfo);
    void OnTbRunLineClick( wxCommandEvent& event );
    void OnTbChangeFontEncodingClick( wxCommandEvent& event );
    void OnMenuClick( wxCommandEvent& event );
    void OnTreectrlActivated( wxTreeEvent& event );
    static bool ShowToolTips();
    wxMutex* mutex;

private:
	void OnLoadResult(wxCommandEvent& event);
	void OnEditNotebookPageChanged(wxAuiNotebookEvent& event);
	void OnCloseButtonClick(wxCloseEvent& event);
	void OnBuildRunLine();
	void OnBuildRunSelected();
	void OnBuildRunAll();
	void OnFileSave();
	void OnFileOpen();
	void OnFileNew ();
	void OnTbClick( wxCommandEvent& event);
	void OnDbListChanged( wxCommandEvent& event );
	void OnEndDrag(wxTreeEvent& event);
	void OnBeginDrag(wxTreeEvent& event);
	void OnAllowNotebookDnD(wxAuiNotebookEvent& evt);
	void OnTbRunClick(wxCommandEvent& event);
	void OnDbMenuContextClick( wxCommandEvent& event );
	MyUI* ui;

protected:
	void OnToolsExportResult();
};

#endif

